package com.ruoyi.model.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.TVehicleModelMapper;
import com.ruoyi.model.domain.TVehicleModel;
import com.ruoyi.model.service.ITVehicleModelService;

/**
 * 车型Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-26
 */
@Service
public class TVehicleModelServiceImpl implements ITVehicleModelService 
{
    @Autowired
    private TVehicleModelMapper tVehicleModelMapper;

    /**
     * 查询车型
     * 
     * @param modelId 车型主键
     * @return 车型
     */
    @Override
    public TVehicleModel selectTVehicleModelByModelId(Long modelId)
    {
        return tVehicleModelMapper.selectTVehicleModelByModelId(modelId);
    }

    /**
     * 查询车型列表
     * 
     * @param tVehicleModel 车型
     * @return 车型
     */
    @Override
    public List<TVehicleModel> selectTVehicleModelList(TVehicleModel tVehicleModel)
    {
        return tVehicleModelMapper.selectTVehicleModelList(tVehicleModel);
    }

    /**
     * 新增车型
     * 
     * @param tVehicleModel 车型
     * @return 结果
     */
    @Override
    public int insertTVehicleModel(TVehicleModel tVehicleModel)
    {
        return tVehicleModelMapper.insertTVehicleModel(tVehicleModel);
    }

    /**
     * 修改车型
     * 
     * @param tVehicleModel 车型
     * @return 结果
     */
    @Override
    public int updateTVehicleModel(TVehicleModel tVehicleModel)
    {
        tVehicleModel.setUpdateTime(DateUtils.getNowDate());
        return tVehicleModelMapper.updateTVehicleModel(tVehicleModel);
    }

    /**
     * 批量删除车型
     * 
     * @param modelIds 需要删除的车型主键
     * @return 结果
     */
    @Override
    public int deleteTVehicleModelByModelIds(Long[] modelIds)
    {
        return tVehicleModelMapper.deleteTVehicleModelByModelIds(modelIds);
    }

    /**
     * 删除车型信息
     * 
     * @param modelId 车型主键
     * @return 结果
     */
    @Override
    public int deleteTVehicleModelByModelId(Long modelId)
    {
        return tVehicleModelMapper.deleteTVehicleModelByModelId(modelId);
    }
}
